package org.secangkirkopipanas.gxtcore.domain.dto;

import net.sf.hibernate4gwt.pojo.java5.LazyPojo;

import org.secangkirkopipanas.gxtcore.domain.ISystemBusinessUnit;
import org.secangkirkopipanas.gxtcore.domain.ISystemGroup;

public class SystemGroupDTO extends LazyPojo implements ISystemGroup {

	private static final long serialVersionUID = 1L;

	public static final long SYSADMIN_GROUP_ID = 0;

	private long id;
	private String name;
	private ISystemBusinessUnit businessUnit;
	private boolean disabled = false;

	public SystemGroupDTO() {
		super();
	}

	public SystemGroupDTO(String name) {
		this(name, null);
	}

	public SystemGroupDTO(String name, ISystemBusinessUnit businessUnit) {
		super();
		this.name = name;
		this.businessUnit = businessUnit;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isSystemAdminGroup() {
		return (SystemGroupDTO.SYSADMIN_GROUP_ID == id);
	}

	public ISystemBusinessUnit getBusinessUnit() {
		return businessUnit;
	}

	public void setBusinessUnit(ISystemBusinessUnit businessUnit) {
		this.businessUnit = businessUnit;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

}
